import request from '../request/request';
export const login = data => {
  return request({
    url: '/login',
    method: 'post',
    data
  })
}
export const getmenu = params => {
  return request({
    url: '/menus',
    method: 'get',
    params
  })
}
export const getuser = data => {
  return request({
    url: '/users',
    method: 'get',
    params:data
  })
}
// 添加用户
export const adduser = data => {
  return request({
    url: '/users',
    method: 'post',
    data
  })
}
// 权限列表
export const getrights = (url,data) => {
  return request({
    url,
    method: 'get',
    data
  })
}
// 角色列表
export const getroles = (data) => {
  return request({
    url:"/roles",
    method: 'get',
    data
  })
}
// 添加角色
export const addroles = (data) => {
  return request({
    url:"/roles",
    method: 'post',
    data
  })
}
// 删除角色
export const delroles = (url) => {
  return request({
    url,
    method: 'delete',
  })
}
// 根据 ID 查询角色
export const searchroles = (url) => {
  return request({
    url,
    method: 'get',
  })
}
// 提交角色修改
export const setfix = (params,url) => {
  return request({
    url,
    method: 'put',
    params
  })
}
// 根据id删除角色权限
export const removerights = (url) => {
  return request({
    url,
    method: 'delete',
  })
}
// 分配权限
export const sentrights = (url,data) => {
  return request({
    url,
    method: 'post',
    data
  })
}
// 商品分类
export const goodscate = (params) => {
  return request({
    url:"/categories",
    method: 'get',
    params
  })
}
// 参数列表
export const getcatelist = (url,params) => {
  return request({
    url,
    method: 'get',
    params
  })
}
// 商品列表
export const getgoodslist = (params) => {
  return request({
    url:"/goods",
    method: 'get',
    params
  })
}
// 删除商品
export const delgoods = (url,params) => {
  return request({
    url,
    method: 'delete',
    params
  })
}
// 订单列表
export const orderList = (params) => {
  return request({
    url:"/orders",
    method: 'get',
    params,
  })
}
// 添加参数
export const addParams = (data,url) => {
  return request({
    url,
    method: 'post',
    data,
  })
}
// 根据id获取分类参数
export const getParams = (params,url) => {
  return request({
    url,
    method: 'get',
    params,
  })
}
// 提交修改参数
export const setParams = (data,url) => {
  return request({
    url,
    method: 'put',
    data,
  })
}
// 删除参数
export const delParams = (url) => {
  return request({
    url,
    method: 'delete'
  })
}
// 获取物流信息
export const kuaidiMessage = (url) => {
  return request({
    url,
    method: 'get'
  })
}